<?php

/**
 * Created by PhpStorm.
 * User: steven
 * Date: 2016/3/25
 * Time: 19:31
 */
class Jsapi_Ticket_Model extends CI_Model
{
    public function __construct()
    {
        $this->load->database();
    }

    public function get_jsapi_ticket(){
        $query = $this->db->get('jsapi_ticket');
        return $query->row_array();
    }

    public function update_jsapi_ticket($data){
        $this->db->where('id',$data['id']);
        $this->db->update('jsapi_ticket',$data);
        $affectioned=$this->db->affected_rows();
        if($affectioned>0){
            return true;
        }else{
            return false;
        }
    }

    public function insert_jsapi_ticket($data){
        $this->db->insert('jsapi_ticket',$data);
        $affectlines=$this->db->affected_rows();
        if($affectlines>0){
            return $this->db->insert_id();
        }else{
            return false;
        }

    }
}